<html>
<body>
<pre>
<?php

require_once("Bootstrap.php");

$gl = new gl();
$gl->setViewPort(new ViewPort(0,0,500,500));
$gl->setMode(gl::Projection);
$gl->matrixLoad(gl::perspective(deg2rad(90),$gl->viewPort->getAspectRatio(),1,1000)); 
//$gl->matrixLoad(gl::orthographic(-10.0, 10.0, -10.0, 10.0, -10.0, 10.0));
$gl->setMode(gl::ModelView);
$gl->matrixLoad(gl::Identity());
$gl->translate3f(0,0,-300);

for($i=0;$i<=90;$i+=5)
{
	$gl->createResource(500,500,200,200,200,0);
	$black = $gl->createColour(0,0,0,1);
	$gl->push();
	$gl->rotate4f(deg2rad($i),0,1,0);
	
	$gl->drawTri(new cPoint3(0,50,0),new cPoint3(50,0,0),new cPoint3(0,-50,0),$black);
	$gl->drawTri(new cPoint3(0,50,0),new cPoint3(-50,0,0),new cPoint3(0,-50,0),$black);
	$gl->pop();
	
	$gl->render('out'.$i.'.png');
	$gl->destroy();
}

?>
</pre>
<br/><br/>
<?php
for($i=0;$i<=90;$i+=5)
{
	echo '<img src="out'.$i.'.png"/><br/>';
}
?>

</body>
</html>